package com.meantodo.demo.domain;

import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.Size;
import lombok.Data;
import org.springframework.data.annotation.Id;
import org.springframework.data.annotation.Transient;
import org.springframework.data.mongodb.core.mapping.Document;

import java.io.Serializable;

/**
 * @Author: tongqianwen
 * @Date: 2025/5/28
 */
@Data
@Document(collection = "users")
public class User implements Serializable {

    @Id
    private String id;

    @NotBlank(message = "user name is required")
    @Size(min = 1, message = "user name must have content")
    private String name;

    private String password;

    @Transient // not store in database
    private String plainPassword;
}
